class demo { public static void main(String args[]) { for(int i=1;i<=10;i++) { double z=Math.sqrt(i); System.out.println("Sqrt of "+i+" is "+z); } } }
Sqrt of 1 is 1.0 Sqrt of 2 is 1.4142135623730951 Sqrt of 3 is 1.7320508075688772 Sqrt of 4 is 2.0 Sqrt of 5 is 2.23606797749979 Sqrt of 6 is 2.449489742783178 Sqrt of 7 is 2.6457513110645907 Sqrt of 8 is 2.8284271247461903 Sqrt of 9 is 3.0 Sqrt of 10 is 3.1622776601683795